<?php
require_once 'dbconnect.php';
$sql = mysql_query("SELECT * FROM users") or die(mysql_error());
$i = 0;
?>
<div class="adat">
    <?php
    while ($rekord = mysql_fetch_array($sql)) {
        ?>
        <div id="<?php echo $rekord['username']; ?>" class="username" onclick="lenyit(<?php echo $i; ?>)" >
            <?php echo $rekord['username']; ?>
            <div id="level">
                <?php echo $rekord['level']; ?>
            </div>
        </div>
        <div id="data<?php echo $i; ?>" class="data">
            <div id="email">
                <?php echo $rekord['email']; ?>
            </div>
            <div id="status">
                <?php
                if ($rekord['status'] == 0) {
                    echo 'offline';
                } elseif ($rekord['status'] == 1) {
                    echo 'online';
                } elseif ($rekord['status'] == -1) {
                    echo 'bannolva';
                } elseif ($rekord['status'] == -2) {
                    echo 'megerősítésre vár';
                }
                ?>
            </div>
            <div class="advanced" id="<?php echo $i; ?>" onclick="kinyit(<?php echo $i; ?>)">
                +
            </div>
        </div>
        <?php
        $i++;
    }
    ?>
</div>
<div class="bovebb">
    <div class="wrapper">
        <div class="tools">
            <div class="options" onclick="bann('ki')">kitiltás</div>
            <div class="options" onclick="user_comments()">hozzászólásai</div>
            <div class="options" onclick="bann('be')">feloldás</div>
        </div>
        <div class="tools2"></div>
    </div>
</div>